﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvDTE;

namespace GordonKristan.codeclean
{
	using System.Collections;
	using System.Windows.Forms;

	public class TextPointSorter : IComparer
	{
		public int Compare(object x, object y)
		{
			//Get the point objects
			TextPoint px = (TextPoint)x;
			TextPoint py = (TextPoint)y;
			//see which one comes after the other
			//we sort by last point first
			if (px.Line - py.Line != 0)
			{
				return px.Line - py.Line;
			}
			else
			{
				return px.DisplayColumn - py.DisplayColumn;
			}
		}
	}
}
